using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ClimbTrigger : MonoBehaviour
{
    void OnTriggerEnter2D(Collider2D collision)
    {
        Core(collision, true);
    }

    void OnTriggerExit2D(Collider2D collision)
    {
        Core(collision, false);
    }
    
    private void Core(Collider2D collision, bool value)
    {
        if (collision.CompareTag(Defines.MainCharacterName))
        {
            var lunaController = collision.GetComponent<LunaController>();
            lunaController.Climb(value);
        }
    }

}
